****Autocratic Revolving Doors****
****Roman-Gabriel Olar****
****Created on 17/02/2022****
****Last modified on 12/12/2024****


*** Figure 1 ***
use "Figure_1.dta", clear
line prop_ARD yr_t, xlabel(1(4)37) ylabel(0(.05)0.35) xtitle("Years of democracy") ytitle("Share of former autocrats in cabinet") scheme(plotplain) 

***Generate elite-country data
use "MainData_ARD_PoP.dta", clear



sort newid year
collapse (max) female first_ARD  major_frev minor_frev first_rev prev_core prev_prestige_2 prev_military ///
		 exit_yr  birthyear  elected appointed app_elec entry_to_trans diff_pol mean_polyarchy max_yr_t ///
		 (lastnm) same same2 gender NUML_aut yr_t ccode prev_gwf_military prev_gwf_party prev_gwf_personal prev_communist party_english prev_portfolio_1 prev_prestige_1 prev_classification gwf_casename gwf_country name age_cab age_exit count_pos ///
		 elite_pact CRT_regime  age_total cab_gwfcaseid cab_gwfname ///
		 cab_tw0 cab_tw1 cab_tw2 cab_tw3 cab_tw4 region  max_spell_dem ///
		 cab_gwf_military cab_gwf_party cab_gwf_personal cab_communist ///
		dem_const new_const coldwar mean_reshuf l_ARD ///
		prev_leader prev_minister yr_since_exit age_entry age_cab_new ///
		(sum)  lustration_pos truthcommission_pos purge_pos rev2dem (firstnm) country_name age (mean) lrgdpopct1 rgdpopc_1yrcht1 litpopt1, by(newid gwf_caseid)
		

***Label all variables
label variable major_frev "Autocratic Revolving Doors"
label variable prev_prestige_2 "Prestigious Portfolio"
label variable prev_military "National Security, Defense & Military"
label variable NUML_aut "No. of Years in Autocratic Cabinet"
label variable prev_core "Core Cabinet Member"
label variable female "Female"
label variable prev_gwf_military "Military"
label variable prev_gwf_party "Single party"
label variable prev_gwf_personal "Personalistic"
label variable lrgdpopct1 "Log GDP/capita t-1"
label variable rgdpopc_1yrcht1 "GDP growth t-1"
label variable litpopt1 "Log population size t-1"

save "MainData_ARD_PoP_CS.dta", replace


*** Generate globals ***		
global ind prev_core NUML_aut prev_prestige_2 prev_military 
global ind2 i.prev_core##i.prev_military  NUML_aut prev_prestige_2 
global pre prev_gwf_military prev_gwf_party prev_gwf_personal
global cabinet cab_gwf_party cab_gwf_personal cab_gwf_military 
global TJ l_lustration_pos l_truthcommission_pos l_purge_pos
global time yr_t yr_since_exit
global macro lrgdpopct1 rgdpopc_1yrcht1 litpopt1
global p2p i.prev_highereducation i.prev_pol_exp i.prev_class i.prev_occupation i.prev_pol_fam


*******************************************
*************Table 1***********************
*******************************************

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***
logit major_frev $ind i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***
logit major_frev $ind i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***
logit major_frev $ind $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

******************************************
********Figures 4, 5, 6 and 7*************
******************************************

use "MainData_ARD_PoP_CS.dta", clear

*** Figure 4 ***
logit major_frev $ind $pre dem_const i.female i.coldwar $macro i.gwf_caseid
margins, dydx(prev_core NUML_aut prev_prestige_2 prev_military) post
estimates store m1
coefplot m1, ///
		 keep(prev_core NUML_aut prev_prestige_2 prev_military) xline(0, lcolor(red)) ///
		 legend(rows(2) position(6)) title("Average Marginal Effects") title("") ///
		  xlabel(-.04(.02).10) legend(off) /// 
		 scheme(plotplain)

*** Figure 5 ***
logit major_frev $ind $pre dem_const i.female i.coldwar $macro i.gwf_caseid
margins, at(NUML_aut=(1(3)37))
marginsplot, ytitle ("Autocratic revolving doors") /// 
			xlabel( 1(4)37 )  ///
			ylabel(0(.02)0.08) /// 
			scheme(plotplain) ///
			addplot(kdensity NUML_aut, yaxis(2) ytitle("", axis(2)) ylabel(0(0.1).4, labsize(2) axis(2))) legend(off)
*** Automated Figure 5 edits ***
gr_edit title.text = {}
// title edits

gr_edit yaxis2.style.editstyle majorstyle(tickstyle(textstyle(size(small)))) editcopy
// yaxis2 size

gr_edit move yaxis2 rightof 7 6
// yaxis2 grid reposition

gr_edit xaxis1.reset_rule 1 37 4 , tickset(major) ruletype(range) 
// xaxis1 edits

gr_edit xaxis1.reset_rule 1 37 4 , tickset(major) ruletype(range) 
// xaxis1 edits

gr_edit xaxis1.title.style.editstyle size(small) editcopy
// title size

gr_edit yaxis1.title.style.editstyle size(small) editcopy
// title size



*** Figure 6 ***
logit major_frev i.prev_core##c.NUML_aut prev_prestige_2 prev_military  $pre dem_const i.female i.coldwar $macro i.gwf_caseid
margins, dydx(prev_core) at(NUML_aut=(1(3)37))
marginsplot, title("Average Marginal Effects") ytitle("Autocratic revolving doors", size(small)) xtitle("No. of Years in Autocratic Cabinet", size(small)) scheme(plotplain) 

*** Figure 7 ***

***Create label for graph***
lab def prev_corelab 0 "Core Cabinet Member=0" 1 "Core Cabinet Member=1" 
lab val prev_core prev_corelab

logit major_frev $ind2 female i.dem_const i.coldwar $pre $macro i.gwf_caseid
margins prev_core, at(prev_military=(0(1)1))
marginsplot, title("") ytitle("Autocratic revolving doors", size(small)) xtitle("National Security, Defense & Military Portfolio", size(small)) recast(scatter) scheme(plotplain) legend(pos(6) col(2) size(vsmall))
		
		
*********************************************************************************************		
	*****************APPENDIX AND ROBUSTNESS CHECKS*********************************
*********************************************************************************************


*** Table A1 ***

use "MainData_ARD_PoP_CS.dta", clear

logit major_frev prev_core i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev  NUML_aut  i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev prev_prestige_2  i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev  prev_military  i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev $ind i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A2 ***
use "MainData_ARD_PoP.dta", clear

logit major_frev prev_core $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev  NUML_aut $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev prev_prestige_2 $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev  prev_military $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

logit major_frev $ind $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A3 ***
*** Model A3.1 ***
use "MainData_ARD_PoP.dta", clear

logit major_frev i.prev_core##c.NUML_aut prev_prestige_2 prev_military   female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid

*** Model A3.2 ***
logit major_frev i.prev_core i.prev_prestige_2##c.NUML_aut prev_military  female i.dem_const i.coldwar $pre $macro i.gwf_caseid
*** Figure A1 ***
margins, dydx(prev_prestige_2) at(NUML_aut=(1(6)37))
marginsplot, scheme(plotplain) yline(0)

*** Model A3.3 ***
logit major_frev i.prev_core i.prev_prestige_2 i.prev_military##c.NUML_aut  female i.dem_const i.coldwar $pre $macro  i.gwf_caseid
*** Figure A2 ***
margins, dydx(prev_military) at(NUML_aut=(1(6)37))
marginsplot, scheme(plotplain) yline(0)


*** Table A4 ***
use "MainData_ARD_PoP.dta", clear
*** Model A4.1 ***
logit major_frev $ind age_new i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model A4.2 ***
logit major_frev $ind age_new $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model A4.3 ***
logit major_frev $ind age_new female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A5 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***
logit major_frev $ind age_cab_new i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***
logit major_frev $ind age_cab_new female i.dem_const i.coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***
logit major_frev $ind age_cab_new i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***
logit major_frev $ind age_cab_new $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***
logit major_frev $ind age_cab_new female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Table A6 ***
*** Run R script named "Table A6.R" ***


*** Table A7 ***

*** The replication of the matching results require access to the Paths to Power data (see Nyrup et al. 2024 - https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4631225). The data is not publicly available yet, ///
*** but the authors are willing to share it with interested parties. Please get in touch with Jacob Nyrup (jacob.nyrup@stv.uio.no) ///
*** to gain access to the data ***

*** Load Paths to Power data ***
import delimited "C:\Users\Administrator\Dropbox\Papers\ARD Elites\Data\Paths_to_Power\P2P.csv", bindquote(strict) encoding(windows-1250) clear
keep year country_isocode country_name name degreetype politicalfamily highereducation class_grouped occupation_grouped_6categories military politician degree

*** Recoding Paths to Power data ***

***Capture political experience
gen pol_exp=1 if politician=="0" | politician=="1"
replace pol_exp=2 if politician=="2"
replace pol_exp=3 if politician=="3"

***Capture class of politician
gen class=1 if class_grouped=="Lower"
replace class=2 if class_grouped=="Middle"
replace class=3 if class_grouped=="Upper"


***Capture occupation
tab occupation
gen occupation=1 if occupation_grouped_6categories=="1. White collar"
replace occupation=2 if occupation_grouped_6categories=="2. Blue collar"
replace occupation=3 if occupation_grouped_6categories=="3. Education"
replace occupation=4 if occupation_grouped_6categories=="4. Media & Popular Culture"
replace occupation=5 if occupation_grouped_6categories=="5. Military & Police"
replace occupation=6 if occupation_grouped_6categories=="6. None or politics"

***Capture political family
tab politicalfamily
gen pol_fam=1 if politicalfamily=="Yes" | politicalfamily=="YES"
replace pol_fam=0 if politicalfamily=="No" | politicalfamily=="NO"

**Capture higher education
tab degree
**Primary education
gen education=1 if degree=="0" | degree=="1" | degree=="2"
**Secondary education and post-secondary (not university)
replace education=2 if degree=="3" | degree=="4" | degree=="5" | degree=="6"
**Higher education
replace education=3 if degree=="7" | degree=="8" | degree=="9" | degree=="10"

tab highereducation
replace highereducation="" if highereducation=="NA"
destring highereducation, replace

*** Keep neccesary variables ***
keep year country_isocode country_name name pol_exp class occupation pol_fam highereducation education


*** Label variables ***
label variable pol_exp "Political experience"
label variable class "Class background (Low, Middle, High)"
label variable occupation "Occupation"
label variable pol_fam "Political family"
label variable highereducation "Higher education"
label variable education "Education level (primary, secondary, higher)"

foreach var of varlist pol_exp class occupation pol_fam highereducation education {
	rename `var' prev_`var'
}

*** Get COW country codes ***
kountry country_isocode, from(iso3c) to(cown)
rename _COWN_ ccode
tab country_name if ccode==.
tab country_isocode if ccode==.
replace ccode=265 if country_isocode=="DDR"
replace ccode=626 if country_isocode=="SSD"
replace ccode=365 if country_isocode=="SUN"

collapse (max) prev_highereducation prev_pol_exp prev_class prev_occupation prev_pol_fam prev_education, by(name ccode)

save "P2P.dta", replace

*** Match P2P into CS dataset ***
use "MainData_ARD_PoP_CS.dta", clear
merge m:1 name ccode using "P2P.dta", keep(master match)

*** Set globals ***
global macro lrgdpopct1 rgdpopc_1yrcht1 litpopt1
global p2p prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam
global time yr_t yr_since_exit
global ind prev_core NUML_aut prev_prestige_2 prev_military 

*** Table A7 ***

*** Drop any missing observations ***
keep major_frev $ind $macro $pre female dem_const coldwar gwf_caseid $p2p ccode newid
foreach v of var $p2p $ind $macro $pre female dem_const coldwar  { 
	drop if missing(`v') 
}

*** Model 1 ***

*** Core position ***
cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1), treatment(prev_core) 

logit major_frev prev_core prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam i.gwf_caseid [iweight=cem_weights]

*** Model 2 ***

*** Dichotomize years in office ***
gen NUML_mean=1 if NUML_aut>5
replace NUML_mean=0 if NUML_mean==.

cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1), treatment(NUML_mean) 

logit major_frev NUML_mean prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam i.gwf_caseid [iweight=cem_weights]

*** Model 3 ***

*** Prestigious portfolio ***
cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1), treatment(prev_prestige_2) 

logit major_frev prev_prestige_2 prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam i.gwf_caseid [iweight=cem_weights]

*** Model 4 ***

*** Military portfolio ***
cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1), treatment(prev_military) 

logit major_frev prev_military prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam i.gwf_caseid [iweight=cem_weights]


*** Table A8 ***
use "MainData_ARD_PoP.dta", clear
merge m:1 name ccode using "P2P.dta", keep(master match)



*** Set macros ***
global macro lrgdpopct1 rgdpopc_1yrcht1 litpopt1
global p2p prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam
global time yr_t yr_since_exit
global ind prev_core NUML_aut prev_prestige_2 prev_military 


***Matching

keep major_frev $ind $macro $pre female dem_const coldwar gwf_caseid $p2p $time ccode newid
foreach v of var $p2p $ind $macro $pre female dem_const coldwar $time { 
	drop if missing(`v') 
}

*** Model 1 ***

*** Core position ***

cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1) , treatment(prev_core) 

logit major_frev prev_core prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam yr_t yr_since_exit i.gwf_caseid [iweight=cem_weights]

*** Model 2 ***

*** Dichotomize years in office ***
gen NUML_mean=1 if NUML_aut>5
replace NUML_mean=0 if NUML_mean==.

cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1) , treatment(NUML_mean) 

logit major_frev NUML_mean prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam yr_t yr_since_exit i.gwf_caseid [iweight=cem_weights]

*** Model 3 ***

*** Prestigious position ***

cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1) , treatment(prev_prestige_2) 

logit major_frev prev_prestige_2 prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam yr_t yr_since_exit i.gwf_caseid [iweight=cem_weights]


*** Model 4 ***

*** Military portfolio ***
cem prev_education(#2) prev_pol_exp(#2) prev_class(#2) prev_occupation(#5) prev_pol_fam(#1), treatment(prev_military) 

logit major_frev prev_military prev_education prev_pol_exp prev_class prev_occupation prev_pol_fam yr_t yr_since_exit i.gwf_caseid [iweight=cem_weights]


*** Table A9 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind mean_reshuf i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind mean_reshuf female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind mean_reshuf i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind mean_reshuf $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind mean_reshuf female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A10 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind count_pos i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind count_pos female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind count_pos i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind count_pos $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind count_pos female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)



*** Table A11 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind cab_gwf_military cab_gwf_party cab_gwf_personal i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind cab_gwf_military cab_gwf_party cab_gwf_personal female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind cab_gwf_military cab_gwf_party cab_gwf_personal i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind cab_gwf_military cab_gwf_party cab_gwf_personal $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind cab_gwf_military cab_gwf_party cab_gwf_personal female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A12 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind i.gwf_caseid if same==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind female dem_const coldwar $pre $macro i.gwf_caseid if same==0
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind i.gwf_caseid if same==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind $time i.gwf_caseid if same==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid if same==0
codebook newid ccode gwf_caseid if e(sample)


*** Table A13 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind i.gwf_caseid if same2==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind female dem_const coldwar $pre $macro i.gwf_caseid if same2==0
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind i.gwf_caseid if same2==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind $time i.gwf_caseid if same2==0
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid if same2==0
codebook newid ccode gwf_caseid if e(sample)


*** Table A14 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind entry_to_trans i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind entry_to_trans female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind entry_to_trans i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind entry_to_trans $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind entry_to_trans female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A15 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind elite_pact i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind elite_pact female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind elite_pact i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind elite_pact $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind elite_pact female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A16 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind lustration_pos truthcommission_pos purge_pos i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind lustration_pos truthcommission_pos purge_pos female dem_const coldwar $pre $macro i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind l_lustration_pos l_truthcommission_pos l_purge_pos i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind l_lustration_pos l_truthcommission_pos l_purge_pos $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind l_lustration_pos l_truthcommission_pos l_purge_pos female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)


*** Table A17 ***

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 1 ***

logit major_frev $ind l_ARD i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind l_ARD $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)

*** Model 3 ***

logit major_frev $ind l_ARD female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook newid ccode gwf_caseid if e(sample)



*** Table A18 ***

use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***

logit major_frev $ind i.gwf_caseid if max_yr_t>3
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***

logit major_frev $ind female dem_const coldwar $pre $macro i.gwf_caseid if max_yr_t>3
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***

logit major_frev $ind i.gwf_caseid if max_yr_t>3
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***

logit major_frev $ind  $time i.gwf_caseid if max_yr_t>3
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***

logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid if max_yr_t>3
codebook newid ccode gwf_caseid if e(sample)



*** Table A19 ***

use "Data_Table A19_CS.dta", clear
*** Model 1 ***

logit major_frev $ind i.ccode
codebook newid ccode  if e(sample)

*** Model 2 ***

logit major_frev $ind female dem_const coldwar $pre $macro i.ccode
codebook newid ccode  if e(sample)


*** TSCS Models ***
use "Data_Table A19.dta", clear

*** Model 3 ***

logit major_frev $ind i.ccode
codebook newid ccode  if e(sample)

*** Model 4 ***

logit major_frev $ind  $time i.ccode
codebook newid ccode if e(sample)

*** Model 5 ***

logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.ccode
codebook newid ccode  if e(sample)


*** Table A20 ***
use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***
logit major_frev $ind i.gwf_caseid if diff_pol>.2
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro i.gwf_caseid if diff_pol>.2
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***
logit major_frev $ind i.gwf_caseid if diff_pol>.2
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***
logit major_frev $ind $time i.gwf_caseid if diff_pol>.2
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid if diff_pol>.2
codebook newid ccode gwf_caseid if e(sample)


*** Table A21 ***
use "MainData_ARD_PoP_CS.dta", clear
*** Model 1 ***
logit major_frev $ind i.gwf_caseid if mean_polyarchy>.6
codebook newid ccode gwf_caseid if e(sample)

*** Model 2 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro i.gwf_caseid if mean_polyarchy>.6
codebook newid ccode gwf_caseid if e(sample)

*** TSCS Models ***
use "MainData_ARD_PoP.dta", clear

*** Model 3 ***
logit major_frev $ind i.gwf_caseid if mean_polyarchy>.6
codebook newid ccode gwf_caseid if e(sample)

*** Model 4 ***
logit major_frev $ind $time i.gwf_caseid if mean_polyarchy>.6
codebook newid ccode gwf_caseid if e(sample)

*** Model 5 ***
logit major_frev $ind female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid if mean_polyarchy>.6
codebook newid ccode gwf_caseid if e(sample)


*** Table A22 ***
use "MainData_ARD_PoP.dta", clear

*** Model 1 ***
logit major_frev i.prev_core##c.yr_t  NUML_aut prev_prestige_2 prev_military  female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook ccode name gwf_caseid if e(sample)

*** Label variable ***
lab def prev_corelab 0 "Non-core autocratic cabinet" 1 "Core autocratic cabinet" 
lab val prev_core prev_corelab

*** Figure A7 ***
margins prev_core, at(yr_t=(1(4)46))
marginsplot, scheme(plotplain) yline(0) legend(pos(6) col(2)) xtitle("Years since transition") ytitle("Autocratic Revolving Doors") title("")

*** Model 2 ***
logit major_frev i.prev_core c.NUML_aut##c.yr_t i.prev_prestige_2  prev_military  female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook ccode name gwf_caseid if e(sample)

*** Figure A8 ***
margins, dydx(NUML_aut) at(yr_t=(1(4)46))
marginsplot, scheme(plotplain) yline(0) legend(pos(6) col(2)) xtitle("Years since transition") ytitle("Autocratic Revolving Doors") title("")


*** Model 3 ***
logit major_frev i.prev_core NUML_aut i.prev_prestige_2##c.yr_t  prev_military  female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook ccode name gwf_caseid if e(sample)

*** Label variable ***
lab def prev_prestige_2lab 0 "Non-prestigious" 1 "Prestigious portfolio" 
lab val prev_prestige_2 prev_prestige_2lab

*** Figure A9 ***
margins prev_prestige_2, at(yr_t=(1(4)46))
marginsplot, scheme(plotplain) yline(0) legend(pos(6) col(2)) xtitle("Years since transition") ytitle("Autocratic Revolving Doors") title("")


*** Model 4 ***
logit major_frev i.prev_core NUML_aut i.prev_prestige_2 i.prev_military##c.yr_t   female i.dem_const i.coldwar $pre $macro $time i.gwf_caseid
codebook ccode name gwf_caseid if e(sample)

*** Label variable ***
lab def prev_military_lab 0 "Non-national defense & military portfolio" 1 "National defense & military portfolio" 
lab val prev_military prev_military_lab

*** Figure A10 ***
margins prev_military, at(yr_t=(1(4)46))
marginsplot, scheme(plotplain) yline(0) legend(pos(6) col(2)) xtitle("Years since transition") ytitle("Autocratic Revolving Doors") title("")
